package com.trip;

import com.trip.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Fuck! 竟然必须在这个包下才能启动任务，可能是依赖@ComponentScan这货有关系，@SpringBootApplication也有关系，总之Fuck！
 */
@Component
public class ScheduledTasks {

    @Autowired
    private DataService dataService;

    @Scheduled(cron = "0 5 0 * * ?")
    public void importTask(){
        dataService.autoImportTask();
    }

}